package com.jrzh.mvc.search.sys;

import org.apache.commons.lang.StringUtils;

import com.jrzh.framework.base.search.BaseSearch;
import com.jrzh.framework.searchutils.Criteria;
import com.jrzh.framework.searchutils.Restrictions;

public class UserSettingSearch extends BaseSearch{
	
	private static final long serialVersionUID = 3642586800345835631L;
	
	private String equalKey;
	
	private String equalUserId;
	
	public String getEqualKey() {
		return equalKey;
	}

	public void setEqualKey(String equalKey) {
		this.equalKey = equalKey;
	}

	public String getEqualUserId() {
		return equalUserId;
	}

	public void setEqualUserId(String equalUserId) {
		this.equalUserId = equalUserId;
	}

	@Override
	public void setCriterias(Criteria<?> criterias) {
		if(StringUtils.isNotBlank(equalKey)) {
			criterias.add(Restrictions.eq("key", equalKey));
		}
		if(StringUtils.isNotBlank(equalUserId)) {
			criterias.add(Restrictions.eq("userId", equalUserId));
		}
	}

}
